<?php
/**
 * Created by PhpStorm.
 * User: zhangrxiang
 * Date: 2017/1/2
 * Time: 21:57
 */

//strripos — 计算指定字符串在目标字符串中最后一次出现的位置（不区分大小写）
$haystack = 'ababcd';
$needle   = 'aB';

$pos      = strripos($haystack, $needle);

if ($pos === false) {
	echo "Sorry, we did not find ($needle) in ($haystack)";
} else {
	echo "Congratulations!\n";
	echo "We found the last ($needle) in ($haystack) at position ($pos)";
}
